// main.c -- Defines the C-code kernel entry point, calls initialisation routines.

#include "monitor.h"
#include "descriptor_tables.h"
#include "timer.h"
#include "paging.h"

extern void init_timer(u32int frequency);
extern void dump_registers();

int main(struct multiboot *mboot_ptr)
{
	// Initialise all the ISRs and segmentation
	init_descriptor_tables();
	// Initialise the screen (by clearing it)
	monitor_clear();

	initialise_paging();
	monitor_write("Kernel from Scratch - 2012\n\n");

	asm volatile ("int $0x3");
	asm volatile ("int $0x4"); 

	/* monitor_put('\n');
	dump_registers();
	/*monitor_put('\n');

    	asm volatile("sti");
    	init_timer(50);	*/
	
	u32int *ptr = (u32int*)0xA0000000;
	u32int do_page_fault = *ptr;

  	return 0xDEADBABA;
} 
